package com.oauth.extensions.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class LoginPanel extends Composite {

	private static final String URL = "http://www.rapwaves.com/";
	private static LoginPanelUiBinder uiBinder = GWT.create(LoginPanelUiBinder.class);

	interface LoginPanelUiBinder extends UiBinder<Widget, LoginPanel> {
	}

	@UiField
	Button signIn;

	@UiField
	HorizontalPanel hPanel;

	public LoginPanel() {
		initWidget(uiBinder.createAndBindUi(this));
		hPanel.setCellHorizontalAlignment(signIn, VerticalPanel.ALIGN_CENTER);
	}

	@UiHandler("signIn")
	public void onClick(ClickEvent pEvent) {
		signIn.setEnabled(false);
		Window.open(URL, "Rapwaves.com - Login", null);
	}
}
